package 洛谷._p1120_小木棍;

import java.util.Scanner;

public class Main {

    static int min = Integer.MAX_VALUE;

    //原始木棍的最小可能长度
    static void dfs(){

    }


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] a = new int[n];
        int min_len = 0;
        int sum_len = 0;
        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
            min_len = Math.max(min_len,a[i]);
            sum_len += a[i];
        }
        for (int i = min_len; i <= sum_len ; i++) {
            if(sum_len%i!=0)
                continue;
            dfs();
        }

//        dfs();
        System.out.println(min_len);
        System.out.println(sum_len);
        scanner.close();

    }
}
